import { Controller, Post, Req } from '@nestjs/common';
import { AddressService } from "./address.service";
import { AddressEntity } from "./address.entity";
import { ApiBasicAuth, ApiExtraModels, ApiOperation, ApiTags } from "@nestjs/swagger";
import { Request } from 'express';
import { ApiResult } from 'src/decorators/api-result.decorator';
import { ResultVo } from 'src/vo/common/result.vo';



@ApiExtraModels(AddressEntity, ResultVo)
@Controller('address')
@ApiTags('address')
@ApiBasicAuth("token")
export class AddressController {
    constructor(private readonly addressService: AddressService) {}

    @Post("queryAll")
    @ApiResult(AddressEntity, true)
    @ApiOperation({ summary: '查询所有数据' })
    async queryAll(@Req() request: Request){
        return await this.addressService.queryAll();
    }
}
